package kyssion.leetcode.num201_250;

public class code231_2的幂 {
    public static void main(String[] args) {
        System.out.println(new code231_2的幂().isPowerOfTwo(1));
    }
    public boolean isPowerOfTwo(int n) {
        if(n==0){
            return false;
        }
        while (n != 0) {
            int x = n & 1;
            n = n >> 1;
            if (x != 0 && n != 0) {
                return false;
            }
        }
        return true;
    }
}
